import cssVar from '@/styles/variables.scss'
import { getRstyle } from '@/utils/theme'
const getters = {
  token: (state) => state.user.token,
  hasUserInfo: (state) => {
    return JSON.stringify(state.user.userInfo) !== '{}'
  },
  userInfo: (state) => state.user.userInfo,
  cssVar: (state) => {
    return {
      ...cssVar,
      ...getRstyle(state.theme.mainColor)
    }
  },
  hamburgerOpen: (state) => state.app.sliderbarOpen,
  lang: (state) => state.app.language,
  mainColor: (state) => state.theme.mainColor,
  tagsList: (state) => state.app.tags
}
export default getters
